package main.test.SparkAPI.Baics


class Person(val firstName:String,val midName:Option[String],val lastName:String){}

object Person {
  def apply(str: String, mid: Option[String], str1: String): Person = {
    new Person(str,mid,str1)
  }

  def unapply(p: Person): Option[(String, Option[String],String)] = {
    if (p.firstName.equalsIgnoreCase("James Bond")) None
    else Some((p.firstName, p.midName,p.lastName))
  }
}
